home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-24 | 34.6 KB | 2,435 lines |
- ACCESS
-
- C
-
- SYSTEM
-
- determine accessibility of a file
-
- 0 on success
- non-zero on failure with errno indicating:
- [ENOTDIR] A component of the path prefix is not a directory.
-
- [ENOENT] If the named file does not exist or the path argument
- points to an empty string.
-
- [EACCES] A component of the path prefix denies search permission,
- or the permission bits of the file mode do not permit the
- requested access.
-
- [EROFS] Write access is requested for a file on a read-only file
- system.
-
- [ETXTBSY] Write access is requested for a pure procedure (shared
- text) file that is being executed.
-
- [EFAULT] path points outside the allocated address space for the
- process.
-
- [EINTR] A signal was caught during the access system call.
-
- [ENOLINK] path points to a remote machine and the link to that machine
- is no longer active.
-
- [EMULTIHOP] Components of path require hopping to multiple remote
- machines.
-
- [ENAMETOOLONG] (POSIX Only) The length of the path argument exceeds
- {PATH_MAX}, or a path name component is longer than {NAME_MAX} while
- {_POSIX_NO_TRUNC} is in effect.
-
- int access (path,amode);
- char *path; /* (r) file specification */
- int amode; /* (r) access mode */
-
- ALARM
-
- C
-
- SYSTEM
-
- set a process alarm clock
-
- The alarm system call returns the amount of time previously remaining
- in the alarm clock of the calling process.
-
- unsigned alarm (sec)
- unsigned sec; /* (r) number of seconds to timeout */
-
- BRK
-
- C
-
- MEMORY
-
- change data segment space allocation
-
- 0 on success, -1 on failure with errno indicating the error:
-
- [ENOMEM] Such a change would result in more space being allocated
- than is allowed by the system-imposed maximum process size.
-
- [EAGAIN] Total amount of system memory available for a read during
- physical IO is temporarily insufficient [see shmop(2)]. This may
- occur even though the space requested was less than the
- system-imposed maximum process size.
-
- int brk(endds)
- char *endds; /* (r) break value to set */
-
- SBRK
-
- C
-
- MEMORY
-
- change data segment space allocation
-
- The previous break value on success, -1 on error with errno
- indicating the error:
- [ENOMEM] Such a change would result in more space being allocated
- than is allowed by the system-imposed maximum process size.
-
- [EAGAIN] Total amount of system memory available for a read during
- physical IO is temporarily insufficient [see shmop(2)]. This may
- occur even though the space requested was less than the
- system-imposed maximum process size.
-
- char *sbrk(incr)
- int incr; /* (r) increment or decrement to break value */
-
- CHDIR
-
- C
-
- SYSTEM
-
- change working directory
-
- 0 on success, non-zero on failure
-
- int chdir(path)
- char *path; /* (r) new working directory */
-
- CHMOD
-
- C
-
- SYSTEM
-
- change mode of file
-
- 0 on success, non-zero on failure
-
- int chmod (path,mode)
- char *path; /* (r) file specification */
- int mode; /* (r) new access permission */
-
- CHOWN
-
- C
-
- SYSTEM
-
- change owner and group of a file
-
- 0 on success, non-zero on failure
-
- int chown (path,owner,group)
- char *path; /* (r) file specification */
- uid_t owner; /* (r) numeric owner id */
- gid_t group; /* (r) numeric group id */
-
- CLOSE
-
- C
-
- UNIX I/O
-
- close a file descriptor
-
- 0 on success, non-zero on failure
-
- int close(fildes)
- int fildes; /* (r) file descriptor to close */
-
- CREAT
-
- C
-
- UNIX I/O
-
- create a new file or rewrite an existing one
-
- Upon successful completion, a non-negative integer, namely the file
- descriptor, is returned. Otherwise, a value of -1 is returned, and
- errno is set to indicate the error.
-
- int creat (path,mode)
- char *path; /* (r) name of new file */
- int mode; /* (r) file mode permissions */
-
- DUP
-
- C
-
- UNIX I/O
-
- duplicate an open file descriptor
-
- Upon successful completion a non-negative integer, namely the file
- descriptor, is returned. Otherwise, a value of -1 is returned, and
- errno is set to indicate the error.
-
- int dup (fildes)
- int fildes; /* (r) the file descriptor to duplicate */
-
- EXECL
-
- C
-
- SUB-PROCESS
-
- execute a file
-
- If exec returns to the calling process, an error has occurred; the
- return value will be -1 and errno will be set to indicate the error.
-
- int execl(path,arg0,arg1,...,argn,(char *)0)
- char *path,*arg0,*arg1,...,*argn;
-
- EXECV
-
- C
-
- SUB-PROCESS
-
- execute a file
-
- If exec returns to the calling process, an error has occurred; the
- return value will be -1 and errno will be set to indicate the error.
-
- int execv(path,argv)
- char *path,*argv[ ];
-
- EXECLE
-
- C
-
- SUB-PROCESS
-
- execute a file
-
- If exec returns to the calling process, an error has occurred; the
- return value will be -1 and errno will be set to indicate the error.
-
- int execle(path,arg0,arg1,...,argn,(char *)0,envp)
- char *path,*arg0,*arg1,...,*argn,*envp[ ];
-
- EXECVE
-
- C
-
- SUB-PROCESS
-
- execute a file
-
- If exec returns to the calling process, an error has occurred; the
- return value will be -1 and errno will be set to indicate the error.
-
- int execve(path,argv,envp)
- char *path,*argv[ ],*envp[ ];
-
- EXECLP
-
- C
-
- SUB-PROCESS
-
- execute a file
-
- If exec returns to the calling process, an error has occurred; the
- return value will be -1 and errno will be set to indicate the error.
-
- int execlp(file,arg0,arg1,...,argn,(char *)0)
- char *file,*arg0,*arg1,...,*argn;
-
- EXECVP
-
- C
-
- SUB-PROCESS
-
- execute a file
-
- If exec returns to the calling process, an error has occurred; the
- return value will be -1 and errno will be set to indicate the error.
-
- int execvp(file,argv)
- char *file,*argv[ ];
-
- EXIT
-
- C
-
- SYSTEM
-
- terminate process
-
- There can be no return from an exit system call.
-
- void exit (status)
- int status;
- void _exit (status)
- int status;
-
- FCNTL
-
- C
-
- UNIX I/O
-
- file control
-
- Upon successful completion, the value returned depends on cmd as
- follows:
- F_DUPFD A new file descriptor.
- F_GETFD Value of flag (only the low-order bit is defined).
- F_SETFD Value other than -1.
- F_GETFL Value of file flags.
- F_SETFL Value other than -1.
- F_GETLK Value other than -1.
- F_SETLK Value other than -1.
- F_SETLKW Value other than -1.
-
- Otherwise, a value of -1 is returned, and errno is set to indicate
- the error.
-
- int fcntl(fildes,cmd,arg)
- int fildes, /* (r) open file descriptor */
- cmd; /* (r) fcntl option select */
- void *arg; /* (r/w) optional argument */
-
- FORK
-
- C
-
- SUB-PROCESS
-
- create a new process
-
- Upon successful completion, fork returns a value of 0 to the child
- process and returns the process ID of the child pro- cess to the
- parent process. Otherwise, a value of -1 is returned to the parent
- process, no child process is created, and errno is set to indicate
- the error.
-
- int fork()
-
- GETPID
-
- C
-
- SYSTEM
-
- get process id
-
- the process ID of the calling process
-
- int getpid()
-
- GETPGRP
-
- C
-
- SYSTEM
-
- get process group id
-
- the process group ID of the calling process
-
- int getpgrp()
-
- GETPPID
-
- C
-
- SYSTEM
-
- get parent process id
-
- the parent process ID of the calling process
-
- int getppid()
-
- GETUID
-
- C
-
- SYSTEM
-
- get real user id
-
- the real user ID of the calling process
-
- int getuid()
-
- GETEUID
-
- C
-
- SYSTEM
-
- get effective user id
-
- the effective user ID of the calling process
-
- int geteuid()
-
- GETGID
-
- C
-
- SYSTEM
-
- get real group id
-
- the real group ID of the calling process
-
- int getgid()
-
- GETEGID
-
- C
-
- SYSTEM
-
- get effective group id
-
- the effective group ID of the calling process
-
- int getegid()
-
- IOCTL
-
- C
-
- SYSTEM
-
- control device
-
- Upon successful completion, the value returned depends upon the
- device control function, but must be a non-negative integer.
- Otherwise, a value of -1 is returned, and errno is set to indicate
- the error.
-
- int ioctl(fildes,request,arg)
- int fildes, /* (r) open file descriptor */
- request; /* (r) ioctl() option selector */
- void *arg; /* (r/w) optional argument(s) */
-
- KILL
-
- C
-
- SYSTEM
-
- send a signal to a process or a group of processes
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int kill (pid,sig)
- int pid, /* (r) process id to receive signal */
- sig; /* (r) signal */
-
- LSEEK
-
- C
-
- SYSTEM
-
- move read/write file pointer
-
- Upon successful completion, a non-negative integer indicating the file
- pointer value is returned. Otherwise, a value of -1 is returned, and
- errno is set to indicate the error.
-
- long lseek (fildes,offset,whence)
- int fildes; /* (r) Unix i/o file descriptor */
- long offset; /* (r)
- int whence;
-
- MKDIR
-
- C
-
- SYSTEM
-
- make a directory
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int mkdir (path,mode)
- char *path; /* (r) name of new directory */
- int mode; /* (r) permissions */
-
- NICE
-
- C
-
- SYSTEM
-
- change priority of a process
-
- Upon successful completion, nice returns the new nice value minus
- 20. Otherwise, a value of -1 is returned, and errno is set to
- indicate the error.
-
- int nice(incr)
- int incr; /* (r) amount to adjust priority */
-
- OPEN
-
- C
-
- SYSTEM
-
- open for reading or writing
-
- Upon successful completion, the file descriptor is returned.
- Otherwise, a value of -1 is returned, and errno is set to indicate
- the error.
-
- int open(path,oflag[,mode])
- char *path; /* (r) path to device or file */
- int oflag, /* (r) file mode */
- mode; /* (r) initial permissions */
-
- PIPE
-
- C
-
- SYSTEM
-
- create an interprocess channel
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int pipe(fildes)
- int fildes[2]; /* fildes[0]/read, fildes[1]/write */
-
- READ
-
- C
-
- SYSTEM
-
- read from file
-
- Upon successful completion a non-negative integer is returned
- indicating the number of bytes actually read. Otherwise, a -1 is
- returned, and errno is set to indicate the error.
-
- int read (fildes, buf, nbyte)
- int fildes; /* (r) open file descriptor */
- char *buf; /* (w) receiving buffer */
- unsigned nbyte; /* (r) number of bytes to read */
-
- RENAME
-
- C
-
- SYSTEM
-
- change the name of a file
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int rename (old, new)
- char *old; /* (r) old name */
- char *new; /* (r) new name */
-
- RMDIR
-
- C
-
- SYSTEM
-
- remove a directory
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int rmdir (path)
- char *path; /* (r) name of directory */
-
- SIGNAL
-
- C
-
- SYSTEM
-
- specify what to do upon receipt of a signal
-
- Upon successful completion, signal returns the previous value of func
- for the specified signal sig. Otherwise, a value of SIG_ERR is
- returned and errno is set to indicate the error. SIG_ERR is defined
- in the include file signal.h.
-
- void (*signal(sig,func))()
- int sig;
- void (*func)();
-
- FSTAT
-
- C
-
- SYSTEM
-
- get open file status
-
- Upon successful completion a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int fstat (fildes,buf)
- int fildes; /* (r) file spec */
- struct stat *buf; /* (w) file information */
-
- STAT
-
- C
-
- SYSTEM
-
- get file status
-
- Upon successful completion a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int stat (path,buf)
- char *path; /* (r) file spec */
- struct stat *buf; /* (w) file information */
-
- TIME
-
- C
-
- SYSTEM
-
- get time
-
- Upon successful completion, time returns the value of time.
- Otherwise, a value of -1 is returned, and errno is set to indicate
- the error.
-
- time_t time(tloc)
- long *tloc; /* (w) time value */
-
- UMASK
-
- C
-
- SYSTEM
-
- set and get file creation mask
-
- The previous value of the file mode creation mask is returned.
-
- int umask (cmask)
- int cmask; /* (r) mask */
-
- UNLINK
-
- C
-
- SYSTEM
-
- remove directory entry
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int unlink (path)
- char *path; /* (r) file specification */
-
- UTIME
-
- C
-
- SYSTEM
-
- set file access and modification times
-
- Upon successful completion, a value of 0 is returned. Otherwise, a
- value of -1 is returned, and errno is set to indicate the error.
-
- int utime (path,times)
- char *path; /* (r) file spec. */
- struct utimbuf *times; /* (r) time structure */
-
- WAIT
-
- C
-
- SYSTEM
-
- wait for child process to stop or terminate
-
- If wait returns due to the receipt of a signal, a value of -1 is
- returned to the calling process, and errno is set to EINTR. If wait
- returns due to a stopped or terminated child process, the process ID
- of the child is returned to the calling process. Otherwise, a value
- of -1 is returned, and errno is set to indicate the error.
-
- int wait(stat_loc)
- int *stat_loc; /* (w) status of sub-process */
-
- WRITE
-
- C
-
- SYSTEM
-
- write on a file
-
- Upon successful completion the number of bytes actually written is
- returned. Otherwise, -1 is returned, and errno is set to indicate
- the error.
-
- int write (fildes,buf,nbyte)
- int fildes; /* (r) open file descriptor */
- char *buf; /* (r) buffer */
- unsigned nbyte; /* (r) number of bytes to write */
-
- ABS
-
- C
-
- MATH
-
- return integer absolute value
-
- the absolute value of its integer operand
-
- int abs(i)
- int i; /* (r) the integer to convert */
-
- ASSERT
-
- C
-
- DIAGNOSTICS
-
- verify program assertion
-
- doesn't
-
- assert (expression)
- int expression; /* (r) expression to evaluate */
-
- BSEARCH
-
- C
-
- SEARCHING
-
- binary search a sorted table
-
- A NULL pointer is returned if the key cannot be found in the table.
-
- char *bsearch((char *) key,(char *) base,nel,sizeof(*key),compar)
- unsigned nel;
- int (*compar)( );
-
- CTIME
-
- C
-
- DATE/TIME
-
- Convert binary time to an ASCII string
-
- ctime returns a pointer to a 26-character string in the following
- form. All the fields have constant width.
-
- Fri Sep 13 00:00:00 1986\n\0
-
- char *ctime(clock)
- time_t *clock;
-
- LOCALTIME
-
- C
-
- DATE/TIME
-
- convert binary Unix time to time structure
-
- localtime returns a pointer to a ``tm'' structure
-
- struct tm *localtime(clock)
- time_t *clock;
-
- GMTIME
-
- C
-
- DATE/TIME
-
- convert binary Unix time to time structure
-
- a pointer to a ``tm'' structure
-
- struct tm *gmtime(clock)
- time_t *clock;
-
- ASCTIME
-
- C
-
- DATE/TIME
-
- convert to string time from the time structure
-
- a pointer to the ASCII string
-
- char *asctime(tm)
- struct tm *tm;
-
- ISDIGIT
-
- C
-
- CHARACTER TEST
-
- test for the digits 0 through 9
-
- nonzero for true, zero for false.
-
- isdigit(ch)
- int ch; /* (r) character to test */
-
- ISXDIGIT
-
- C
-
- CHARACTER TEST
-
- Test for hex digit
-
- nonzero for true, zero for false.
-
- isxdigit(ch)
- int ch; /* (r) character to test */
-
- ISLOWER
-
- C
-
- CHARACTER TEST
-
- test for lower case character
-
- nonzero for true, zero for false.
-
- islower(ch)
- int ch; /* (r) character to test */
-
- ISUPPER
-
- C
-
- CHARACTER TEST
-
- test for upper case character
-
- nonzero for true, zero for false.
-
- isupper(ch)
- int ch; /* (r) character to test */
-
- ISALPHA
-
- C
-
- CHARACTER TEST
-
- test for alphabetic character
-
- nonzero for true, zero for false.
-
- isalpha(ch)
- int ch; /* (r) character to test */
-
- ISALNUM
-
- C
-
- CHARACTER TEST
-
- test for alphanumeric character
-
- nonzero for true, zero for false.
-
- isalnum(ch)
- int ch; /* (r) character to test */
-
- ISSPACE
-
- C
-
- CHARACTER TEST
-
- test for character that generates printed space
-
- nonzero for true, zero for false.
-
- isspace(ch)
- int ch; /* (r) character to test */
-
- ISCNTRL
-
- C
-
- CHARACTER TEST
-
- test for control character
-
- nonzero for true, zero for false.
-
- iscntrl(ch)
- int ch; /* (r) character to test */
-
- ISPUNCT
-
- C
-
- CHARACTER TEST
-
- test for punctuation character
-
- nonzero for true, zero for false.
-
- ispunct(ch)
- int ch; /* (r) character to test */
-
- ISPRINT
-
- C
-
- CHARACTER TEST
-
- test for character that is printable including space
-
- nonzero for true, zero for false.
-
- isprint(ch)
- int ch; /* (r) character to test */
-
- ISGRAPH
-
- C
-
- CHARACTER TEST
-
- test for character that is printable excluding space
-
- nonzero for true, zero for false.
-
- isgraph(ch)
- int ch; /* (r) character to test */
-
- ISASCII
-
- C
-
- CHARACTER TEST
-
- test for character contained in ASCII character set
-
- nonzero for true, zero for false.
-
- isascii(ch)
- int ch; /* (r) character to test */
-
- TOLOWER
-
- C
-
- CHARACTER CONVERSION
-
- convert character to lower case
-
- nonzero for true, zero for false.
-
- tolower(ch)
- int ch; /* (r) character to convert */
-
- TOUPPER
-
- C
-
- CHARACTER CONVERSION
-
- convert character to upper case
-
- the character converted to upper case
-
- toupper(ch)
- int ch; /* (r) character to convert */
-
- TOASCII
-
- C
-
- CHARACTER CONVERSION
-
- converts a character to ASCII
-
- the converted character as an integer
-
- toascii(ch)
- int ch; /* (r) character to convert */
-
- CUSERID
-
- C
-
- SYSTEM
-
- get character login name of the user
-
- If the login name cannot be found, cuserid returns a NULL pointer; if
- s is not a NULL pointer, a null character (\0) will be placed at
- s[0].
-
- char *cuserid (s)
- char *s; /* (w) buffer for name */
-
- DUP2
-
- C
-
- UNIX I/O
-
- duplicate an open file descriptor
-
- Upon successful completion a non-negative integer, namely the file
- descriptor, is returned. Otherwise, a value of -1 is returned, and
- errno is set to indicate the error.
-
- int dup2 (fildes,fildes2)
- int fildes, /* (r) current file descriptor */
- fildes2; /* (r) new file descriptor */
-
- ECVT
-
- C
-
- CONVERSION
-
- convert floating-point number to string
-
- a pointer to the converted string
-
- char *ecvt(value,ndigit,decpt,sign)
- double value;
- int ndigit,
- *decpt,
- *sign;
-
- FCVT
-
- C
-
- CONVERSION
-
- convert floating-point number to string
-
- a pointer to the converted string
-
- char *fcvt(value,ndigit,decpt,sign)
- double value;
- int ndigit,
- *decpt,
- *sign;
-
- GCVT
-
- C
-
- CONVERSION
-
- convert floating-point number to string
-
- a pointer to the converted string
-
- char *gcvt(value,ndigit,buf)
- double value;
- int ndigit;
- char *buf;
-
- EXP
-
- C
-
- MATH
-
- calculate exponent
-
- the exponent of x
-
- double exp(x)
- double x;
-
- LOG
-
- C
-
- MATH
-
- calculate log
-
- the log of x
-
- double log(x)
- double x;
-
- LOG10
-
- C
-
- MATH
-
- calculate log10
-
- log10 of x
-
- double log10(x)
- double x;
-
- POW
-
- C
-
- MATH
-
- calculate power
-
- the power of xy
-
- double pow(x,y)
- double x,y;
-
- SQRT
-
- C
-
- MATH
-
- calculate square root
-
- the square root of x
-
- double sqrt(x)
- double x;
-
- FCLOSE
-
- C
-
- STANDARD I/O
-
- close a stream
-
- 0 for success and EOF if any error (such as trying to write to a file
- that has not been opened for writing) was detected.
-
- int fclose(stream)
- FILE *stream;
-
- FFLUSH
-
- C
-
- STANDARD I/O
-
- flush a stream
-
- 0 for success and EOF if any error (such as trying to write to a file
- that has not been opened for writing) was detected.
-
- int fflush(stream)
- FILE *stream;
-
- FERROR
-
- C
-
- STANDARD I/O
-
- check for an i/o error on a stream
-
- error status
-
- int ferror(stream)
- FILE *stream;
-
- FEOF
-
- C
-
- STANDARD I/O
-
- check for an EOF on a stream
-
- EOF status
-
- int feof(stream)
- FILE *stream;
-
- CLEARERR
-
- C
-
- STANDARD I/O
-
- reset the EOF and error status on a stream
-
- void
-
- void clearerr(stream)
- FILE *stream;
-
- FILENO
-
- C
-
- STANDARD I/O
-
- get the file descriptor for a file pointer
-
- a file descriptor
-
- int fileno(stream)
- FILE *stream;
-
- FLOOR
-
- C
-
- MATH
-
- calculate largest integer less than another double
-
- the largest integer
-
- double floor(x)
- double x;
-
- CEIL
-
- C
-
- MATH
-
- calculate smallest integer greater than another double
-
- smallest integer
-
- double ceil(x)
- double x;
-
- FMOD
-
- C
-
- MATH
-
- calculate floting-point remainder
-
- remainder
-
- double fmod(x,y)
- double x, y;
-
- FABS
-
- C
-
- MATH
-
- calculate floating-point absolute value
-
- absolute value
-
- double fabs(x)
- double x;
-
- FOPEN
-
- C
-
- STANDARD I/O
-
- open a stream
-
- NULL on failure
-
- FILE *fopen(filename,type)
- char *filename,
- *type;
-
- FREOPEN
-
- C
-
- STANDARD I/O
-
- reopen a stream
-
- NULL on failure
-
- FILE *freopen(filename,type,stream)
- char *filename,
- *type;
- FILE *stream;
-
- FDOPEN
-
- C
-
- STANDARD I/O
-
- open a stream associated with a file descriptor
-
- NULL on failure
-
- FILE *fdopen(fildes,type)
- int fildes;
- char *type;
-
- FREAD
-
- C
-
- STANDARD I/O
-
- binary read from a stream
-
- the number of items read. If nitems is non-positive, no characters
- are read, and 0 is returned
-
- int fread(ptr,size,nitems,stream)
- char *ptr;
- int nitems;
- size_t size;
- FILE *stream;
-
- FWRITE
-
- C
-
- STANDARD I/O
-
- binary write to a stream
-
- the number of items written. If nitems is non-positive, no
- characters are written, and 0 is returned fwrite.
-
- int fwrite(ptr,size,nitems,stream)
- char *ptr;
- int nitems;
- size_t size;
- FILE *stream;
-
- FSEEK
-
- C
-
- STANDARD I/O
-
- reposition a stream
-
- 0 on success, non-zero for improper seeks
-
- int fseek(stream,offset,ptrname)
- FILE *stream;
- long offset;
- int ptrname;
-
- REWIND
-
- C
-
- STANDARD I/O
-
- reposition a stream to the beginning
-
- void
-
- void rewind(stream)
- FILE *stream;
-
- FTELL
-
- C
-
- STANDARD I/O
-
- get current file position on a stream
-
- the current file position
-
- long ftell(stream)
- FILE *stream;
-
- GETC
-
- C
-
- STANDARD I/O
-
- read a character on a stream
-
- EOF at end-of-file or upon an error
-
- int getc(stream)
- FILE *stream;
-
- GETCHAR
-
- C
-
- STANDARD I/O
-
- read a character from standard input
-
- EOF at end-of-file or upon an error
-
- int getchar()
-
- FGETC
-
- C
-
- STANDARD I/O
-
- read a character from a stream
-
- EOF at end-of-file or upon an error
-
- int fgetc(stream)
- FILE *stream;
-
- GETW
-
- C
-
- STANDARD I/O
-
- read the next word on a stream
-
- EOF at end-of-file or upon an error
- Because EOF is a valid integer, ferror() should be used to detect getw
- errors.
-
- int getw(stream)
- FILE *stream;
-
- GETCWD
-
- C
-
- SYSTEM
-
- get path name of current working directory
-
- Returns NULL with errno set if size is not large enough, or if an
- error occurs in a lower-level function.
-
- char *getcwd(buf,size)
- char *buf;
- int size;
-
- GETENV
-
- C
-
- SYSTEM
-
- return value for environment name
-
- a pointer to the string or NULL on failure
-
- char *getenv (name)
- char *name;
-
- GETS
-
- C
-
- STANDARD I/O
-
- read a string from standard input
-
- the string on success, NULL on failure
-
- char *gets(s)
- char *s;
-
- FGETS
-
- C
-
- STANDARD I/O
-
- read a string from a stream
-
- the string on success, NULL on failure
-
- char *fgets(s,n,stream)
- char *s;
- int n;
- FILE *stream;
-
- LOCKF
-
- C
-
- UNIX I/O
-
- record locking on files
-
- Upon successful completion, a value of 0 is returned. Oth- erwise, a
- value of -1 is returned and errno is set to indi- cate the error.
-
- int lockf(fildes,function,size)
- long size;
- int fildes,
- function;
-
- MALLOC
-
- C
-
- MEMORY ALLOCATION
-
- allocate memory
-
- a pointer to allocated memory or NULL on failure
-
- char *malloc(size)
- unsigned size;
-
- FREE
-
- C
-
- MEMORY ALLOCATION
-
- free allocated memory
-
- void
-
- void free(ptr)
- char *ptr;
-
- REALLOC
-
- C
-
- MEMORY ALLOCATION
-
- reallocate memory
-
- a pointer to allocated memory or NULL on failure
-
- char *realloc(ptr,size)
- char *ptr;
- unsigned size;
-
- CALLOC
-
- C
-
- MEMORY ALLOCATION
-
- allocate memory and clear
-
- a pointer to allocated memory or NULL on failure
-
- char *calloc(nelem,elsize)
- unsigned nelem,
- elsize;
-
- MEMCCPY
-
- C
-
- MEMORY
-
- copy memory up to a specified character
-
- a pointer on success, NULL on failure to find c
-
- char *memccpy(s1,s2,c,n)
- char *s1,
- *s2;
- int c,
- n;
-
- MEMCHR
-
- C
-
- MEMORY
-
- find first occurance of a character in a buffer
-
- the first character or NULL if not found
-
- char *memchr(s,c,n)
- char *s;
- int c,
- n;
-
- MEMCMP
-
- C
-
- MEMORY
-
- compare buffers
-
- less than (negative), equal to (0), or greater than (positive)
-
- int memcmp(s1,s2,n)
- char *s1,
- *s2;
- int n;
-
- MEMCPY
-
- C
-
- MEMORY
-
- copy characters from one buffer to another
-
- s1
-
- char *memcpy(s1,s2,n)
- char *s1,
- *s2;
- int n;
-
- MEMSET
-
- C
-
- MEMORY
-
- fill a buffer with a specified character
-
- s
-
- char *memset(s,c,n)
- char *s;
- int c,
- n;
-
- MKTEMP
-
- C
-
- FILENAME
-
- make a unique file name
-
- The address of the string on success, NULL on failure
-
- char *mktemp(template)
- char *template;
-
- PERROR
-
- C
-
- ERROR
-
- display the message for the last error condition
-
- void
-
- void perror(s)
- char *s;
-
- POPEN
-
- C
-
- STANDARD I/O
-
- open a pipe to a process
-
- NULL pointer if files or processes cannot be created.
-
- FILE *popen(command,type)
- char *command,
- *type;
-
- PCLOSE
-
- C
-
- STANDARD I/O
-
- close a pipe to a process
-
- -1 if stream is not associated with a ``popened'' command.
-
- int pclose(stream)
- FILE *stream;
-
- PRINTF
-
- C
-
- STANDARD I/O
-
- format output to Standard Output
-
- the number of characters transmitted, or a negative value if an output
- error was encountered.
-
- int printf(format,arg ... )
- char *format;
-
- FPRINTF
-
- C
-
- STANDARD I/O
-
- format output to a stream
-
- the number of characters transmitted, or a negative value if an
- output error was encountered.
-
- int fprintf(stream,format,arg ... )
- FILE *stream;
- char *format;
-
- SPRINTF
-
- C
-
- CONVERSION
-
- convert to string with various formats
-
- the number of characters converted (not including the \0), or a
- negative value if a conversion error was encountered.
-
- int sprintf(s,format[,arg ] ... )
- char *s,
- *format;
-
- PUTC
-
- C
-
- STANDARD I/O
-
- write a character to a stream
-
- The value written, or EOF on failure
-
- int putc(c,stream)
- int c;
- FILE *stream;
-
- PUTCHAR
-
- C
-
- STANDARD I/O
-
- write a character to standard output
-
- The value written, or EOF on failure
-
- int putchar(c)
- int c;
-
- FPUTC
-
- C
-
- STANDARD I/O
-
- write a character to a stream
-
- The value written, or EOF on failure
-
- int fputc(c,stream)
- int c;
- FILE *stream;
-
- PUTW
-
- C
-
- STANDARD I/O
-
- write a word to a stream
-
- The value written, or EOF on failure (ferror() should be used to
- check for errors.
-
- int putw(w,stream)
- int w;
- FILE *stream;
-
- PUTENV
-
- C
-
- SYSTEM
-
- change or add value to environment
-
- non-zero if it was unable to obtain enough space via malloc for an
- expanded environment, otherwise zero.
-
- int putenv(string)
- char *string;
-
- PUTS
-
- C
-
- STANDARD I/O
-
- put a string on Standard Output
-
- 0 on success, EOF on failure
-
- int puts(s)
- char *s;
-
- FPUTS
-
- C
-
- STANDARD I/O
-
- put a string on a stream
-
- 0 on success, EOF on failure
-
- int fputs(s,stream)
- char *s;
- FILE *stream;
-
- QSORT
-
- C
-
- SORT
-
- quicker sort
-
- void
-
- void qsort((char *) base,nel,sizeof(*base),compar)
- unsigned nel;
- int (*compar)( );
-
- RAND
-
- C
-
- RANDOM NUMBER
-
- generate a random number
-
- a random number between 0 and (2^15)-1
-
- int rand()
-
- SRAND
-
- C
-
- RANDOM NUMBER
-
- seed the random number generator
-
- void
-
- void srand(seed)
- unsigned seed;
-
- SCANF
-
- C
-
- STANDARD I/O
-
- convert and format for output to Standard Output
-
- the number of successfully matched and assigned input items; this
- number can be zero in the event of an early conflict between an input
- character and the control string. If the input ends before the first
- conflict or conversion, EOF is returned.
-
- int scanf(format [,pointer] ... )
- char *format;
-
- FSCANF
-
- C
-
- STANDARD I/O
-
- convert and format for output to a stream
-
- EOF on end of input and a short count for missing or illegal data
- items.
-
- int fscanf(stream,format [,pointer] ... )
- FILE *stream;
- char *format;
-
- SSCANF
-
- C
-
- CONVERSION
-
- convert from string to various formats
-
- EOF on end of input and a short count for missing or illegal data
- items.
-
- int sscanf(s,format [,pointer] ... )
- char *s,
- *format;
-
- SETBUF
-
- C
-
- STANDARD I/O
-
- modify standard i/o buffer
-
- void
-
- void setbuf(stream,buf)
- FILE *stream;
- char *buf;
-
- SETVBUF
-
- C
-
- STANDARD I/O
-
- modify standard i/o buffer
-
- non-zero for illegal types or sizes
-
- int setvbuf(stream,buf,type,size)
- FILE *stream;
- char *buf;
- int type, size;
-
- SETJMP
-
- C
-
- FLOW CONTROL
-
- non-local goto
-
- 0
-
- int setjmp(env)
- jmp_buf env;
-
- LONGJMP
-
- C
-
- FLOW CONTROL
-
- non-local goto
-
- void
-
- void longjmp(env,val)
- jmp_buf env;
- int val;
-
- SLEEP
-
- C
-
- TIMING
-
- suspend execution for interval
-
- the unslept amount
-
- unsigned sleep(seconds)
- unsigned seconds;
-
- STRCAT
-
- C
-
- STRING
-
- unbounded string concatenation
-
- a pointer to the result
-
- char *strcat(s1,s2)
- char *s1,*s2;
-
- STRDUP
-
- C
-
- STRING
-
- duplicate a string
-
- pointer to duplicated string or NULL on failure
-
- char *strdup(s1)
- char *s1;
-
- STRNCAT
-
- C
-
- STRING
-
- bounded string concatentation
-
- a pointer to the result
-
- char *strncat(s1,s2,n)
- char *s1,*s2;
- size_t n;
-
- STRCMP
-
- C
-
- STRING
-
- unbounded string compare
-
- the compare result
-
- int strcmp(s1,s2)
- char *s1,*s2;
-
- STRNCMP
-
- C
-
- STRING
-
- bounded string compare
-
- the compare result
-
- int strncmp(s1,s2,n)
- char *s1,*s2;
- size_t n;
-
- STRCPY
-
- C
-
- STRING
-
- unbounded string copy
-
- a pointer to the result
-
- char *strcpy(s1,s2)
- char *s1,*s2;
-
- STRNCPY
-
- C
-
- STRING
-
- bounded string copy
-
- a pointer to the result
-
- char *strncpy(s1,s2,n)
- char *s1,*s2;
- size_t n;
-
- STRLEN
-
- C
-
- STRING
-
- find the length of a string
-
- the string length
-
- int strlen(s)
- char *s;
-
- STRCHR
-
- C
-
- STRING
-
- find the first occurance of a character in a string
-
- the character or NULL if not found
-
- char *strchr(s,c)
- char *s;
- int c;
-
- STRRCHR
-
- C
-
- STRING
-
- find the last occurance of a character in a string
-
- the character or NULL if not found
-
- char *strrchr(s,c)
- char *s;
- int c;
-
- STRPBRK
-
- C
-
- STRING
-
- find a break character in a string
-
- the string or NULL if it does not exist
-
- char *strpbrk(s1,s2)
- char *s1,*s2;
-
- STRSPN
-
- C
-
- STRING
-
- extract an inclusive segment from a string
-
- the length of the segment
-
- int strspn(s1,s2)
- char *s1,*s2;
-
- STRCSPN
-
- C
-
- STRING
-
- extract an exclusive segment from a string
-
- the length of the segment
-
- int strcspn(s1,s2)
- char *s1,*s2;
-
- STRTOK
-
- C
-
- STRING
-
- extract a token from a string
-
- the token or NULL when no more tokens
-
- char *strtok(s1,s2)
- char *s1,*s2;
-
- STRTOD
-
- C
-
- CONVERSION
-
- convert string numeric to double
-
- the string converted to double or _HUGE on overflow
-
- double strtod(str,ptr)
- char *str,
- **ptr;
-
- ATOF
-
- C
-
- CONVERSION
-
- convert string numeric to float
-
- the string converted to double or _HUGE on overflow
-
- double atof(str)
- char *str;
-
- STRTOL
-
- C
-
- CONVERSION
-
- convert string numeric to integer
-
- the numeric string converted to long
-
- long strtol(str,ptr,base)
- char *str,
- **ptr;
- int base;
-
- ATOL
-
- C
-
- CONVERSION
-
- convert string numeric to integer
-
- the string converted to long
-
- long atol(str)
- char *str;
-
- ATOI
-
- C
-
- CONVERSION
-
- convert string numeric to integer
-
- an integer converted from string numeric
-
- int atoi(str)
- char *str;
-
- SWAB
-
- C
-
- CONVERSION
-
- swap bytes
-
- void
-
- void swab(from,to,nbytes)
- char *from,
- *to;
- int nbytes;
-
- SYSTEM
-
- C
-
- SYSTEM
-
- issue a command-interpreter command
-
- the exit status of the command
-
- int system(command)
- char *command;
-
- TMPFILE
-
- C
-
- STANDARD I/O
-
- create a temporary file
-
- a FILE pointer or NULL on failures
-
- FILE *tmpfile()
-
- TMPNAM
-
- C
-
- FILENAME
-
- create a name for a temporary file
-
- a pointer to the name or NULL on failure
-
- char *tmpnam(s)
- char *s;
-
- TEMPNAM
-
- C
-
- FILENAME
-
- create a name for a temporary file
-
- a pointer to the name or NULL on failure
-
- char *tempnam(dir,pfx)
- char *dir,
- *pfx;
-
- SIN
-
- C
-
- MATH
-
- calculate the sine
-
- the sine in radians
-
- double sin(x)
- double x;
-
- COS
-
- C
-
- MATH
-
- calculate the cosine
-
- the cosine in radians
-
- double cos(x)
- double x;
-
- TAN
-
- C
-
- MATH
-
- calculate the tangent
-
- the tangent in radians
-
- double tan(x)
- double x;
-
- ASIN
-
- C
-
- MATH
-
- calculate the arcsine
-
- the arcsine of x
-
- double asin(x)
- double x;
-
- ACOS
-
- C
-
- MATH
-
- calculate the arccosine
-
- the arccosine of x
-
- double acos(x)
- double x;
-
- ATAN
-
- C
-
- MATH
-
- calculate the arctangent
-
- the arctangent of x
-
- double atan(x)
- double x;
-
- ATAN2
-
- C
-
- MATH
-
- calculate the arctangent of y/x
-
- the arctangent of y/x
-
- double atan2(y,x)
- double y,
- x;
-
- ISATTY
-
- C
-
- SYSTEM
-
- determine origin of file descriptor
-
- 1 if fildes is associated with a terminal device, 0 otherwise.
-
- int isatty (fildes)
- int fildes;
-
- UNGETC
-
- C
-
- STANDARD I/O
-
- push character back into input stream
-
- ungetc returns EOF if it cannot insert the character.
-
- int ungetc(c,stream)
- int c;
- FILE *stream;
-
-